<?php
// +----------------------------
// | Created by PhpStorm
// +----------------------------
// | Author: YnnSon
// +----------------------------
namespace app\api\controller\v1;

use app\api\model\Feedback as FeedbackModel;
use app\api\validate\FeedbackValidate;
use think\Request;

/**
 * 意见反馈
 * Class Feedback
 * @package app\api\controller\v1
 */
class Feedback extends BaseController
{
    /**
     * @desc 检查用户权限
     */
    protected $beforeActionList = [
        'checkUserScope' => ['only' => 'feedback'], // 方法名必须全部小写，逗号中间不能有空格！！！
    ];

    /**
     * @Desc 添加意见
     * @return \app\lib\exception\SuccessMessage|bool
     */
    public function insertFeedback()
    {
        (new FeedbackValidate())->goCheck();
        $param = Request::instance()->post();
        return FeedbackModel::insertFeedback($param);
    }
}